Skip to content

improve expr float() and int() to handle strings #161

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 31, 2024

Conversation

fatpat
Copy link
Contributor

@fatpat fatpat commented Dec 30, 2024

try to better handle string to int and string to float in expressions

case string:
value, err := strconv.ParseInt(v, 10, 64)
if err != nil {
panic(err)
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not confident that we want to panic here. It's user supplied data after all. So a single malformed MQTT message will bring the exporter into a crashloop? 🤔

@hikhvar hikhvar merged commit 6bd07d1 into hikhvar:master Dec 31, 2024
15 of 16 checks passed
@fatpat fatpat deleted the expr_int/float branch January 1, 2025 06:09
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants